package com.bianyuanren.v4.utils;

import jdk.nashorn.internal.objects.NativeUint8Array;

import java.util.Calendar;

/**
 * @author 微笑的你
 * @version 1.0
 * @date 2020/4/16 0016 下午 3:58
 */
public class ActiveTimeUtil {

    public static String activeTime(Long activeTime) {
        if (activeTime<60){
            //活跃多少分钟前
            return activeTime+"分钟";
        }else
        //判断活跃时间是否大于一小时
        if (activeTime >=60 && activeTime<1440){
            //活跃多少小时前
            int hours = (int) Math.floor(activeTime / 60);
            long minute = activeTime % 60;
            // return hours + "小时" + minute + "分钟";
            return hours + "小时";
        }else {
            //活跃多少天前
            int day = (int) Math.floor(activeTime / 1440);
            return day + "天";
        }

    }
}
